From: Luca BRUNO Date: Tue, 7 Dec 2021 16:16:39 +0000 (+0000) Subject: lib/repo: do no return an arbitrary mode on failure X-Git-Tag: archive/raspbian/2022.1-3+rpi1^2~12^2^2~10^2~1 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=4a0ebe507fae41e7f080e15c492f629fdeeaf4ca;p=ostree.git lib/repo: do no return an arbitrary mode on failure This turns the existing check into an assert. Otherwise, the previous code may return an arbitrary repo mode (bare) on failure. --- diff --git a/src/libostree/ostree-repo.c b/src/libostree/ostree-repo.c index 85700b03..f07d2235 100644 --- a/src/libostree/ostree-repo.c +++ b/src/libostree/ostree-repo.c @@ -3816,7 +3816,8 @@ ostree_repo_equal (OstreeRepo *a, OstreeRepoMode ostree_repo_get_mode (OstreeRepo *self) { - g_return_val_if_fail (self->inited, FALSE); + g_assert (self != NULL); + g_assert (self->inited); return self->mode; }